From taj at undine.linuxgrrls.org Tue Apr 29 13:28:14 2003 From: taj at undine.linuxgrrls.org (Trent Jarvi) Date: Tue Mar 14 23:21:43 2006 Subject: [Rxtx] RE: 485 port In-Reply-To: References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj@hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx@hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx@hex.linuxgrrls.org > > [mailto:owner-rxtx@hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx@hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Tue Mar 14 23:21:43 2006 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Tue Mar 14 23:21:43 2006 Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule@7b5.de --- weule@acm.org --- > > -- Trent Jarvi taj@www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Tue Mar 14 23:21:43 2006 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 14 23:21:43 2006 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Tue Mar 14 23:21:43 2006 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx@linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 14 23:21:43 2006 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx@linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx@linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Tue Mar 14 23:21:43 2006 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Tue Mar 14 23:21:43 2006 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx@linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx@linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Tue Mar 14 23:21:43 2006 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 14 23:21:43 2006 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Tue Mar 14 23:21:43 2006 Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj@www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj@parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj@parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj@hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx@hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx@hex.linuxgrrls.org > > [mailto:owner-rxtx@hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx@hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Tue Mar 28 18:25:02 2006 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0001.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Tue Mar 28 18:25:02 2006 Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule@7b5.de --- weule@acm.org --- > > -- Trent Jarvi taj@www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Tue Mar 28 18:25:02 2006 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 28 18:25:02 2006 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Tue Mar 28 18:25:02 2006 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx@linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0001.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 28 18:25:02 2006 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx@linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx@linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Tue Mar 28 18:25:02 2006 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0001.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Tue Mar 28 18:25:02 2006 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx@linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx@linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Tue Mar 28 18:25:02 2006 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 28 18:25:02 2006 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Tue Mar 28 18:25:02 2006 Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj@www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj@parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj@parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj@hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx@hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx@hex.linuxgrrls.org > > [mailto:owner-rxtx@hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx@hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Tue Mar 28 20:17:02 2006 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0002.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Tue Mar 28 20:17:02 2006 Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule@7b5.de --- weule@acm.org --- > > -- Trent Jarvi taj@www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Tue Mar 28 20:17:02 2006 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 28 20:17:02 2006 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Tue Mar 28 20:17:02 2006 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx@linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0002.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 28 20:17:02 2006 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx@linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx@linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Tue Mar 28 20:17:02 2006 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0002.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Tue Mar 28 20:17:03 2006 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx@linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx@linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Tue Mar 28 20:17:03 2006 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 28 20:17:03 2006 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Tue Mar 28 20:17:03 2006 Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj@www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj@parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj@parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0003.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0003.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0003.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0004.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0004.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0004.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0005.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0005.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0005.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0006.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0006.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0006.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0007.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0007.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0007.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0008.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0008.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0008.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0009.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0009.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0009.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0010.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0010.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0010.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0011.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0011.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0011.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0012.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0012.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0012.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0013.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0013.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0013.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0014.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0014.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0014.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0015.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0015.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0015.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0016.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0016.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0016.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0017.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0017.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0017.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0018.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0018.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0018.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0019.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0019.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0019.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0020.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0020.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0020.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0021.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0021.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0021.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0022.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0022.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0022.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0023.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0023.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0023.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0024.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0024.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0024.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0025.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0025.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0025.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0026.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0026.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0026.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0027.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0027.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0027.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0028.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0028.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0028.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0029.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0029.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0029.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0030.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0030.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0030.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0031.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0031.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0031.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0032.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0032.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0032.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0033.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0033.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0033.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0034.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0034.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0034.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0035.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0035.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0035.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0036.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0036.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0036.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0037.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0037.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0037.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0038.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0038.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0038.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0039.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0039.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0039.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0040.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0040.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0040.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0041.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0041.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0041.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0042.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0042.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0042.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0043.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0043.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0043.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0044.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0044.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0044.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0045.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0045.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0045.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0046.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0046.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0046.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0047.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0047.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0047.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0048.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0048.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0048.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0049.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0049.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0049.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0050.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0050.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0050.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0051.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0051.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0051.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0052.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0052.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0052.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0053.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0053.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0053.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0054.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0054.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0054.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0055.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0055.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0055.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0056.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0056.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0056.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0057.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0057.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0057.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0058.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0058.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0058.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0059.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0059.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0059.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0060.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0060.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0060.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0061.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0061.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0061.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0062.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0062.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0062.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0063.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0063.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0063.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0064.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0064.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0064.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0065.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0065.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0065.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0066.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0066.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0066.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0067.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0067.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0067.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0068.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0068.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0068.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0069.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0069.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0069.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0070.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0070.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0070.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0071.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0071.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0071.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0072.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0072.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0072.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0073.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0073.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0073.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0074.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0074.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0074.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0075.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0075.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0075.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0076.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0076.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0076.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0077.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0077.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0077.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0078.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0078.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0078.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0079.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0079.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0079.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0080.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0080.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0080.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0081.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0081.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0081.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0082.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0082.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0082.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0083.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0083.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0083.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0084.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0084.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0084.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0085.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0085.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0085.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0086.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0086.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0086.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0087.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0087.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0087.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0088.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0088.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0088.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0089.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0089.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0089.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0090.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0090.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0090.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0091.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0091.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0091.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0092.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0092.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0092.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0093.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0093.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0093.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0094.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0094.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0094.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0095.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0095.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0095.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0096.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0096.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0096.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0097.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0097.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0097.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0098.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0098.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0098.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0099.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0099.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0099.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0100.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0100.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0100.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0101.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0101.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0101.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0102.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0102.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0102.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0103.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0103.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0103.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0104.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0104.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0104.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0105.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0105.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0105.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0106.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0106.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0106.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0107.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0107.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0107.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0108.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0108.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0108.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0109.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0109.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0109.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0110.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0110.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0110.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0111.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0111.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0111.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0112.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0112.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0112.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0113.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0113.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0113.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0114.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0114.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0114.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0115.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0115.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0115.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0116.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0116.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0116.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0117.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0117.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0117.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0118.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0118.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0118.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0119.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0119.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0119.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0120.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0120.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0120.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0121.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0121.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0121.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0122.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0122.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0122.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0123.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0123.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0123.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0124.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0124.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0124.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0125.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0125.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0125.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0126.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0126.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0126.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0127.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0127.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0127.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0128.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0128.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0128.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0129.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0129.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0129.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0130.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0130.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0130.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0131.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0131.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0131.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0132.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0132.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0132.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0133.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0133.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0133.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0134.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0134.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0134.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0135.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0135.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0135.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0136.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0136.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0136.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0137.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0137.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0137.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0138.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0138.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0138.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0139.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0139.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0139.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0140.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0140.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0140.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0141.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0141.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0141.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0142.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0142.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0142.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0143.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0143.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0143.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0144.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0144.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0144.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0145.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0145.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0145.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0146.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0146.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0146.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0147.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0147.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0147.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0148.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0148.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0148.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0149.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0149.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0149.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0150.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0150.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0150.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0151.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0151.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0151.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0152.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0152.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0152.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0153.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0153.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0153.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0154.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0154.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0154.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0155.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0155.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0155.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0156.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0156.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0156.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0157.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0157.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0157.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0158.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0158.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0158.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0159.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0159.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0159.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0160.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0160.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0160.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0161.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0161.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0161.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0162.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0162.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0162.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0163.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0163.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0163.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0164.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0164.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0164.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0165.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0165.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0165.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0166.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0166.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0166.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0167.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0167.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0167.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0168.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0168.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0168.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0169.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0169.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0169.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0170.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0170.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0170.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0171.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0171.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0171.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0172.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0172.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0172.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0173.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0173.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0173.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0174.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0174.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0174.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0175.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0175.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0175.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0176.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0176.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0176.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0177.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0177.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0177.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0178.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0178.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0178.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0179.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0179.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0179.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0180.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0180.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0180.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0181.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0181.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0181.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0182.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0182.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0182.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0183.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0183.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0183.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0184.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0184.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0184.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0185.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0185.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0185.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0186.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0186.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0186.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0187.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0187.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0187.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0188.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0188.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0188.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0189.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0189.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0189.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0190.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0190.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0190.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0191.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0191.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0191.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0192.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0192.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0192.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0193.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0193.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0193.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0194.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0194.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0194.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0195.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0195.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0195.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0196.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0196.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0196.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0197.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0197.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0197.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0198.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0198.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your application: > 2click on jar file, 2clickable application? > what jdk do you use? > did you install keyspan driver you do you have old serial hardware > interfaces? > > Dmitry Markman > > On Friday, May 2, 2003, at 07:40 US/Eastern, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar seems to be looking for "libSolarisSerialParallel.so" >> instead of the RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2808 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/ed13c87e/attachment-0198.bin From dmarkman at mac.com Fri May 2 10:50:33 2003 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 2 May 2003 12:50:33 -0400 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <30D61387-7CBE-11D7-921B-000393DC71BC@mac.com> How you run your application: 2click on jar file, 2clickable application? what jdk do you use? Dmitry Markman On Friday, May 2, 2003, at 12:11 US/Eastern, Trent Jarvi wrote: > > Hi Tobie > > I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X > generally likes to use rxtx 2.1 if I'm not mistaken. > > But all I can say with some confidence having never had a chance to run > Mac OS X is that some assumption in #1 is wrong. I assume the > location is > just wrong but I'll just step back now and wait for more qualified > people > to speak there. > > On Fri, 2 May 2003, Tobie Kerridge wrote: > >> Hi Trent, thanks for the pointers, I'm a little confused with file >> locations. here's what i have: >> >> 1. javax.comm.properties >> /System/Library/Frameworks/JavaVM.framework/Home/lib >> (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") >> 2. comm.jar >> /System/Library/Frameworks/JavaVM.framework/Home/lib/ext >> 3. jcl.jar and librxtxSerial.jnilib >> /Library/Java/Extensions >> >> I got all theses locations from "README.MACOSX", which I followed >> pretty carefully. Do I have another properties file somewhere? >> comm.jar >> seems to be looking for "libSolarisSerialParallel.so" instead of the >> RXTX libraries. Am I misunderstanding something? >> >> >> On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: >> >>> >>> SolarisSerial is the native library for Sun's Commapi on Solaris. >>> RXTX >>> 2.0 should be able to work with this jar. The fact that the Solaris >>> native library is trying to be loaded suggests that the >>> javax.comm.properties file was not found by Sun's comm.jar. >>> >>> On Thu, 1 May 2003, Tobie Kerridge wrote: >>> >>>> Hi, >>>> >>>> JavaKit app loads on os x 10.2, but a serial port is not available >>>> to >>>> use. I get this response in the shell: >>>> >>>> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >>>> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >>>> SolarisSerialParallel in java.library.path >>>> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >>>> loading >>>> driver com.sun.comm.SolarisDriver >>>> >>>> I installed RXTX successfully (i think!) using the project builder >>>> source, and added javacomm as sugested. Like the reccent os x >>>> poster, >>>> I'm named in the uucp group. >>>> >>>> Any suggestions would be great >>>> >>>> bests, >>>> Tobie >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at linuxgrrls.org >>>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >>> >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > From tobie at mac.com Sat May 3 06:30:40 2003 From: tobie at mac.com (Tobie Kerridge) Date: Sat, 3 May 2003 13:30:40 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Bob, thank you! Works like a dream. After a whole day fiddling I was getting a bit despondent. Still, it was nice getting my hands dirty, now that I've washed them! Did I say thank you? best wishes, Tobie On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > If you just want a working RXTX install, the installer from JMRI might > be what you want: > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > I'd be interested to hear if it works for you. > > Bob From taj at linuxgrrls.org Sat May 3 07:00:23 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 3 May 2003 14:00:23 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> References: <0D0EE6AA-7D63-11D7-BB03-000393DA715A@mac.com> Message-ID: I had to look and refresh my memory. The JMRI project is a collection of tools for model railroad computer control. It is platform-independent, and aims to be a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch. Author: Bob Jacobsen http://freshmeat.net/projects/jmri/ A real hobby use :) On Sat, 3 May 2003, Tobie Kerridge wrote: > Bob, > > thank you! Works like a dream. After a whole day fiddling I was > getting a bit despondent. Still, it was nice getting my hands dirty, > now that I've washed them! > > Did I say thank you? > > best wishes, > Tobie > > On Saturday, May 3, 2003, at 09:09 am, Bob Jacobsen wrote: > > > If you just want a working RXTX install, the installer from JMRI might > > be what you want: > > > > > > http://prdownloads.sourceforge.net/jmri/> JavaCommInstaller2.hqx?download > > > > I'd be interested to hear if it works for you. > > > > Bob > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at parcelfarce.linux.theplanet.co.uk Sat May 3 08:58:29 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Sat, 3 May 2003 15:58:29 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh (fwd) Message-ID: Version 2 fixes some issues J?rg ran into. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 03 May 2003 16:45:08 +0200 From: Joerg Weule To: taj at parcelfarce.linux.theplanet.co.uk Subject: Re: ChangePackage.sh taj at parcelfarce.linux.theplanet.co.uk wrote: > Thanks Joerg > > I'll put this in contrib and let the mail-list know about it. > > On Thu, 1 May 2003, Joerg Weule wrote: > > Here a new version. Is it true, that CLASSTOP and other strings at the Makefiles has also have to be changed? ------------------------------------------------------ #!/bin/sh # Don't use! :) # # Create a ed-cmd for the change of one pattern # case $1 in gnu) X=g/javax_comm/s+javax_comm+gnu_io+g ;; javax) X=g/gnu_io/s+gnu_io+javax_comm+g ;; *) echo gnu or javax ? ; exit 0 ;; esac # # ed will be used to keep the owner and mode of the files unchanged. # We have run the ed-script for the characters '.' '/' as well. # "tr _ $D" do the change. # find . -type f -a -print | grep -v $0 | (while read F ; do ( echo $X; echo $X| tr _ /; echo $X| tr _ .; echo w; echo q ) | ed $F 2>&1 >/dev/null done ) # # Now we do little changes at the Makefiles. Hope that all we need. # find . -name Makefile\* -a -print | (while read F ; do cat < References: Message-ID: On Tue, 29 Apr 2003, Ricardo Trindade wrote: > Hi, > > Regarding my recent issues with 485 without a converter, I found this email > you sent me a while ago. > > I found that the 485 port on my pc doesn't do any type of send data > control, so it's not really the same as a converter. The port requires that > the DTR or RTS (not sure wich or even if both) be raised before writes and > droped after. In this situation I imagine such a port would require low > level software support. I'm a little confused here. How do you know the port on your PC is RS485? Its rather unusual to have on a PC. It is possible to try making a RS232 port talk to an RS485 port. What do you know about port? Are you sure it isnt a RS232 UART? I'm going to guess this is RS232 from what you have said. Maybe you have a link to the specs of the product mentioned? > > I have been trying to use it as a 232 port (just to test, didn't expect it > to work), but of course doing the timing in java didn't work properly. I get > readings from the driver, but most of the time the data has errors. > > So my questions are : > > -do you know if there is any support in linux/windows for 485 ? Over time, people have hacked together solutions either in the kernel or in C libraries. If you look at the RXTXImp.c you will see the code in write() that does this in userland. It sounds like you have been bit by timing problems trying to do this from Java. The native code can do it faster but from what I am able to gather, moving to userland C may not always work. It may work. You can just put the code to raise and lower the control lines right into SerialImp.c for testing. I can help some there. It may not work. The suggested solution is to use a hardware converter. > -do you think that the support in native rxtx lib will be "low level" > enough to work properly ? The kernel can be made to support this. If you ask the kernel developers, they will suggest its not a priority. You could also look at using real time linux. Quickly, the converter looks like a more convenient solution. > -is the fact that my pc reports a 232 port a consequence of me using > /dev/tty ? is there another device for a 485 port ? There may be some confusion here. The RS485 classes are there for people that would like to modify them. I think the code is essentially there but stopped working on them after digging through old serial and linux kernel mail lists. So rxtx does not try to enumerate 'RS485' ports. The intention of the classes was to make RS232 work like RS485. You can see the hack here from RS485Imp.c JNIEXPORT void JNICALL Java_gnu_io_RS485Port_writeByte( JNIEnv *env, jobject jobj, jint ji ) { unsigned char byte = (unsigned char)ji; int fd = get_java_var( env, jobj,"fd","I" ); int result=0,count=0; /* turn on the DTR */ ioctl(fd, TIOCMGET, &result); result |= TIOCM_DTR; ioctl(fd, TIOCMSET, &result); /* send the data */ ... /* shut down the DTR */ ioctl(fd, TIOCMGET, &result); result &= ~TIOCM_DTR; ioctl(fd, TIOCMSET, &result); This could easily be placed in SerialImp.c to try the 'low level' solution. If you have a card that requires some low level call that replaces the above automatically with DTR/RTS, that would be more of a kernel driver issue. The kernel driver would then support an ioctl() call to do that. > > I've been trying to test the rxtx 485 code, but I can't use it because my > os (linux) reports my 485 port as a 232 port, and rxtx only gives me a > 485Port class if the os reports a 485 port (am I right on this ?) If it truely is an RS485 port (on the PC side), the raising and lowering of control lines should just happen on write. At least thats my understanding. To keep things simple, I'd put the RS485 classes on the side for now and just look at the above change suggested for SerialImp.c. See if you can get writeByte() to work. I'll forward this to the rxtx mail-list. Perhaps others will have comments that could help. > > any ideas about this ? > > hope to be able to work with you to provide adequate 485 support in rxtx. > > -----Mensagem original----- > De: Trent Jarvi [mailto:taj at hex.linuxgrrls.org] > Enviada: quinta-feira, 3 de Abril de 2003 23:21 > Para: Ricardo Trindade > Cc: Crucius, Wesley; rxtx at hex.linuxgrrls.org > Assunto: RE: 485 port > > > On Thu, 3 Apr 2003, Ricardo Trindade wrote: > > > Thanks. > > > > I already use 232-485 converters that handle that themselves. I was > guessing > > that if advantech markets a 485 port, it would also do it, but I'm not > sure > > anymore... > > > > Ricardo > > > > -----Mensagem original----- > > De: owner-rxtx at hex.linuxgrrls.org > > [mailto:owner-rxtx at hex.linuxgrrls.org]Em nome de Crucius, Wesley > > Enviada: quinta-feira, 3 de Abril de 2003 15:20 > > Para: 'Ricardo Trindade'; 'rxtx at hex.linuxgrrls.org' > > Assunto: RE: 485 port > > > > > > Ricardo, > > > > Don't know anything about that particular hardware, but the problem that > > usually bites anyone using RS-485 hardware is transmitter enable. If you > > try to do it in software, you almost always have problems if you operate > at > > higher baud rates, and the definition of higher baud rates depends on your > > hardware, your OS, and even your code. Get an RS-485 board that does > > hardware based transmitter enable and your life will be MUCH easier. > Check > > out the 7404 from www.sealevel.com as a very good example of this. I've > > used it extensively and have had very good results. > > > > Wes > > > > I think there is a little confusion. Since this email is going on both on > and off the list I'll try to answer the questions here. > > Wes's idea is going to be the most foolproof. It should work. But it > sounds like you have something like this so it should be fine. If your > rs232-485 converter is not working with rxtx Serial communication then the > port is either not set up properly or there is a bug in rxtx. > > If you remove the 485-232 converter, I'd not expect things to work too > well but there is some (untested) code in rxtx that may work. It will > probably require modification. If one wants to look into this I can help. > You will need to use something like: > > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_RS485 > ... > > This class has native code that raises and drops DTR on writes. In > RS485Imp.c the code looks like: > > /* turn on the DTR */ > ioctl(fd, TIOCMGET, &result); > result |= TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > ..write data > > ioctl(fd, TIOCMGET, &result); > result &= ~TIOCM_DTR; > ioctl(fd, TIOCMSET, &result); > > (these calls should work on w32 with the termios.c) > > There will probably need to be other changes. That was what I put in. > > but for this to work properly, RXTXCommDriver.java will need to have the > RS485 port type setup for enumeration here: > > ~line 299 > for (int > PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PA > RALLEL;PortType++) > > > Finally, you could try using the PORT_SERIAL without the 485-232 converter > and do the line control from Java but I suspect you will find the timing > is not adequate. > > If you are just trying to get RS485 working somehow, use the converter and > us PORT_SERIAL. Treat it as another 232 port. > > From bernard.perrin at csem.ch Thu May 1 08:03:09 2003 From: bernard.perrin at csem.ch (Bernard PERRIN) Date: Thu, 01 May 2003 16:03:09 +0200 Subject: [Rxtx] Rxtx & OSX Message-ID: Hello, I manually installed rxtx version 2.1-6 on my Mac under OSX, following the MacOSX file guidelines. I did it manually since the installer was hanging. MANUALLY: copy RXTXcomm.jar -> /Library/Java/Extensions copy libSerial.jnilib -> /Library/Java/Extensions I also took into account the ?AFTER INSTALLATION VERY IMPORTANT? note. When I check the uucp members, I get: % niutil -readprop / /groups/uucp users zeboss bpe So everything seems to be fine. However, when I try to test it with a very simple program (see below), I get: % java -cp ".:/Library/Java/Extensions/RXTXcomm.jar" SerialTest java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:832) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at SerialTest.main(SerialTest.java:10) Moreover, the environment variable DYLD_LIBRARY_PATH is set to /Library/Java/Extensions (I also tried with LD_LIBRARY_PATH). Thanks in advance to any suggestion, Best regards, Bernard PS: I use a USB to serial adapter, so my device is /dev/tty.usbserial-001. It works well with ZTerm or with a Tcl/Tk program. Now I would like to use it with Java. I also used successfully this serial link with Lejos, a java environment for the lego Mindstorm. I was using pcrcxcomm.jar classes file to communicate. SerialTest.java: import java.util.*; import gnu.io.*; import java.lang.*; import java.io.*; public class SerialTest { public static void main(String args[]) { CommPortIdentifier portId; Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030501/085de9ab/attachment-0199.html From taj at parcelfarce.linux.theplanet.co.uk Thu May 1 13:24:39 2003 From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk) Date: Thu, 1 May 2003 20:24:39 +0100 (BST) Subject: [Rxtx] Re: ChangePackage.sh In-Reply-To: <3EB1506D.9000206@7b5.de> Message-ID: Thanks Joerg I'll put this in contrib and let the mail-list know about it. On Thu, 1 May 2003, Joerg Weule wrote: > Hello Trent, > > your ChangePackage.sh script is moving files around dropping the file > permissions. > Please find my version using the ed for changes inside the files. Since > the files > are written back, no permissions are changed. > > Here are several things changes: > - Use of find ... | ( while read I ; do ... ; done ) > to allow thousands of files. > - Use of grep to keep this script unchanged > - A little help for calls without any parameter. > - Only one process called for each file. > > Since ed and sed are very simular, this script should also run on every > UNX platform: > > ----------------------------------------------------- > #!/bin/sh > # Don't use! :) > > # Use a temp file for ed commands > F=/tmp/ChangeRXTX > > # First a comand file is created. > case $1 in > gnu) > cat <$F > ,s+javax/comm+gnu/io+g > ,s+javax_comm+gnu_io+g > ,s+javax.comm+gnu.io+g > w > q > EOF > ;; > javax) > cat <$F > ,s+gnu/io+javax/comm+g > ,s+gnu_io+javax_comm+g > ,s+gnu.io+javax.comm+g > w > q > EOF > ;; > *) > echo Dont use is for gnu or javax !!! > exit 0 > esac > > ls -l $F > > #Now find a lot of files an change them, this will work for thousends of > files... > find . -type f -a -print | > grep -v $0 | > (while read I ; do echo $I ; ed $I <$F 2>&1 >/dev/null ; done ) > > rm $F > ------------------------------------------------------- > Regards > > J?rg > > J?rg Weule --- weule at 7b5.de --- weule at acm.org --- > > -- Trent Jarvi taj at www.linux.org.uk From tobie at mac.com Thu May 1 14:20:50 2003 From: tobie at mac.com (Tobie Kerridge) Date: Thu, 1 May 2003 21:20:50 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Hi, JavaKit app loads on os x 10.2, but a serial port is not available to use. I get this response in the shell: [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I installed RXTX successfully (i think!) using the project builder source, and added javacomm as sugested. Like the reccent os x poster, I'm named in the uucp group. Any suggestions would be great bests, Tobie From taj at linuxgrrls.org Thu May 1 14:40:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 1 May 2003 21:40:14 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> References: <667452DF-7C12-11D7-B6F3-0003934FB39E@mac.com> Message-ID: SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX 2.0 should be able to work with this jar. The fact that the Solaris native library is trying to be loaded suggests that the javax.comm.properties file was not found by Sun's comm.jar. On Thu, 1 May 2003, Tobie Kerridge wrote: > Hi, > > JavaKit app loads on os x 10.2, but a serial port is not available to > use. I get this response in the shell: > > [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > > I installed RXTX successfully (i think!) using the project builder > source, and added javacomm as sugested. Like the reccent os x poster, > I'm named in the uucp group. > > Any suggestions would be great > > bests, > Tobie > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From tobie at mac.com Fri May 2 05:40:34 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 12:40:34 +0100 Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: Message-ID: Hi Trent, thanks for the pointers, I'm a little confused with file locations. here's what i have: 1. javax.comm.properties /System/Library/Frameworks/JavaVM.framework/Home/lib (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") 2. comm.jar /System/Library/Frameworks/JavaVM.framework/Home/lib/ext 3. jcl.jar and librxtxSerial.jnilib /Library/Java/Extensions I got all theses locations from "README.MACOSX", which I followed pretty carefully. Do I have another properties file somewhere? comm.jar seems to be looking for "libSolarisSerialParallel.so" instead of the RXTX libraries. Am I misunderstanding something? On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > 2.0 should be able to work with this jar. The fact that the Solaris > native library is trying to be loaded suggests that the > javax.comm.properties file was not found by Sun's comm.jar. > > On Thu, 1 May 2003, Tobie Kerridge wrote: > >> Hi, >> >> JavaKit app loads on os x 10.2, but a serial port is not available to >> use. I get this response in the shell: >> >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no >> SolarisSerialParallel in java.library.path >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while >> loading >> driver com.sun.comm.SolarisDriver >> >> I installed RXTX successfully (i think!) using the project builder >> source, and added javacomm as sugested. Like the reccent os x poster, >> I'm named in the uucp group. >> >> Any suggestions would be great >> >> bests, >> Tobie >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1997 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20030502/bc347415/attachment-0199.bin From taj at linuxgrrls.org Fri May 2 10:11:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 2 May 2003 17:11:16 +0100 (BST) Subject: [Rxtx] no serial port available in JavaKit... In-Reply-To: References: Message-ID: Hi Tobie I take it Dmitry is on vacation. He is the Mac OS X expert. Mac OS X generally likes to use rxtx 2.1 if I'm not mistaken. But all I can say with some confidence having never had a chance to run Mac OS X is that some assumption in #1 is wrong. I assume the location is just wrong but I'll just step back now and wait for more qualified people to speak there. On Fri, 2 May 2003, Tobie Kerridge wrote: > Hi Trent, thanks for the pointers, I'm a little confused with file > locations. here's what i have: > > 1. javax.comm.properties > /System/Library/Frameworks/JavaVM.framework/Home/lib > (file contains 1 line, "Driver=gnu.io.RXTXCommDriver") > 2. comm.jar > /System/Library/Frameworks/JavaVM.framework/Home/lib/ext > 3. jcl.jar and librxtxSerial.jnilib > /Library/Java/Extensions > > I got all theses locations from "README.MACOSX", which I followed > pretty carefully. Do I have another properties file somewhere? comm.jar > seems to be looking for "libSolarisSerialParallel.so" instead of the > RXTX libraries. Am I misunderstanding something? > > > On Thursday, May 1, 2003, at 09:40 pm, Trent Jarvi wrote: > > > > > SolarisSerial is the native library for Sun's Commapi on Solaris. RXTX > > 2.0 should be able to work with this jar. The fact that the Solaris > > native library is trying to be loaded suggests that the > > javax.comm.properties file was not found by Sun's comm.jar. > > > > On Thu, 1 May 2003, Tobie Kerridge wrote: > > > >> Hi, > >> > >> JavaKit app loads on os x 10.2, but a serial port is not available to > >> use. I get this response in the shell: > >> > >> [SW16:tini/tini1.11/bin] tobie% java -cp tini.jar JavaKit > >> Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > >> SolarisSerialParallel in java.library.path > >> Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > >> loading > >> driver com.sun.comm.SolarisDriver > >> > >> I installed RXTX successfully (i think!) using the project builder > >> source, and added javacomm as sugested. Like the reccent os x poster, > >> I'm named in the uucp group. > >> > >> Any suggestions would be great > >> > >> bests, > >> Tobie > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://undine.linuxgrrls.org/mailman/listinfo/rxtx > >> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From tobie at mac.com Fri May 2 11:48:16 2003 From: tobie at mac.com (Tobie Kerridge) Date: Fri, 2 May 2003 18:48:16 +0100 Subject: [Rxtx] no serial port available in JavaKit... Message-ID: <40BF6D92-7CC6-11D7-9A8B-0003934FB39E@mac.com> The application is JavaKit from the tini1.11 developer kit. I run the application from a shell with this line (there's more details in my original post): >>>> % java -cp tini.jar JavaKit I've installed apple's recent java 1.4.1 developer update, rxtx rxtx-2.0-5 needed this to install. Yup, I'm using keyspans pda adapter, and it is running fine in other serial applications like MacBS2 for basic stamps. I'm quite prepared to go a completely different route if someone has things running on a similar set up, rxtx 2.1 was mentioned by Trent, but I can't find much documentation. bests, Tobie On Friday, May 2, 2003, at 05:52 pm, Dmitry Markman wrote: > How do you run your applicati